#include "fMain.h"

fMain::fMain()
{
}

void fMain::setupUi(QWidget *parent)
{
	/*
		Creations
	*/
	if (parent->objectName().isEmpty())
		parent->setObjectName("fMain");
	parent->setWindowTitle(tr("ToQo"));
	
	taskTree = new CTaskTreeWidget(parent);
	taskTree->setObjectName("taskTree");
	
	btRefresh = new QPushButton(parent);
	btRefresh->setObjectName("btRefresh");
	btRefresh->setIcon(QIcon(QPixmap(":/pixmaps/pixmaps/refresh.png")));
	btRefresh->setText(tr("Refresh"));
	btRefresh->setToolTip(tr("Refresh task list"));
	
	btAdd = new QPushButton(parent);
	btAdd->setObjectName("btAdd");
	btAdd->setIcon(QIcon(QPixmap(":/pixmaps/pixmaps/add.png")));
	btAdd->setToolTip(tr("Add task"));
	btAdd->setEnabled(false);
	
	eAddTask = new QLineEdit(parent);
	eAddTask->setObjectName("eAddTask");
	eAddTask->setToolTip(tr("Title for a new task"));
	
	cbProviderList = new QComboBox(parent);
	cbProviderList->setObjectName("cbProviderList");
	
	/*
		Connections
	*/
	
	
	/*
		Layout
	*/
	
	// Add and refresh
	QHBoxLayout *hbAddRefresh = new QHBoxLayout;
	hbAddRefresh->addWidget(eAddTask);
	hbAddRefresh->addWidget(btAdd);
	hbAddRefresh->addWidget(cbProviderList);
	hbAddRefresh->addWidget(btRefresh);
	
	// All
	QVBoxLayout *vbAll = new QVBoxLayout;
	vbAll->addWidget(taskTree);
	vbAll->addLayout(hbAddRefresh);
	
	parent->setLayout(vbAll);
}
